<!DOCTYPE html>

<html>

<head>
    <title></title>
    <script src='../vue.js'></script>
</head>

<body>
    <div id="app-2">
        <my-component></my-component>
    </div>
    <script>
        var Child = {
            template: '<div>A custom component!</div>'
        };
        new Vue({
            el: '#app-2',
            components: {
                // <my-component> 将只在父模板可用
                'my-component': Child
            }
        })
    </script>
</body>


</html>